package com.ait.cms.controller;


import com.ait.cms.entity.CrmBanner;
import com.ait.cms.service.CrmBannerService;
import com.ait.commonutils.Msg;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-06-26
 */
@RestController
@RequestMapping("/cms/Banner")
public class BannerFrontController {

    @Autowired
    private CrmBannerService crmBannerService;



    @ApiOperation("获取所有Banner")
    @GetMapping("getBannerAll")
    public Msg getBannerAll(){
        List<CrmBanner> list = crmBannerService.SelectAllBanner();
        if (list.size()>0)return Msg.success().data("list",list);
        return Msg.fail();
    }
}

